import { AnyAction } from 'redux';
import ACTIONS from 'constants/action';

export default (state = { collapsed: true }, action: AnyAction) => {
  switch (action.type) {
    case ACTIONS.CHANGE_LAYOUT_COLLAPSED: {
      const collapsed = action.data.collapsed;
      return { ...state, collapsed };
    }

    default:
      return state;
  }
};
